import * as React from "react";
import * as ReactDOM from "react-dom";

import "./CheckNextAgent.less";
import NavBar from "../Components/NavBar/NavBar";


export interface CheckNextAgentProps {

}

export interface State {
    NextAgentList: any
}

export default class CheckNextAgent extends React.Component<CheckNextAgentProps, State> {
    //默认属性
    static readonly defaultProps: CheckNextAgentProps = {};

    constructor(props: CheckNextAgentProps) {
        super(props);
        //默认状态
        this.state = {
            NextAgentList: [
                {
                    "Name": "钟文",
                    "WeChat": "zhongwen123168",
                    "Phone": "15219844787",
                    "AuthorizationCode": "ABGHE19",
                    "BrandLevelName": "2盒折扣零售",
                    "CardPath": "http://haijisz8.hyxmt.cn:80/NewCustomer/CardShow.aspx?v=6225D9EEFC33866B7FAF12A9EA88ACD432320980292B6905&",
                    "BrandField1": "",
                    "BrandField2": "",
                    "BrandField3": "",
                    "BrandField4": "",
                    "BrandField5": "",
                    "Brand_ParentName": "向明涛",
                    "CustomField5": "广东省龙川县紫市镇民乐西村委会增新村",
                    "CustomField6": "广东省",
                    "CustomField7": "河源市",
                    "CustomField8": "",
                    "HeadUrl": "http://haijisz8.hyxmt.cn/Upload/ShareUrl/20180708/201807081608597108333.jpg",
                    "Customer_ID": 167672,
                    "Brand_ID": 1,
                    "BrandName": null,
                    "BrandLevel": 8,
                    "RowNo": 2,
                    "LowerState": "0",
                    "Brand_ParentId": 3351,
                    "State": "1",
                    "Qty": 0,
                    "TeamQty": 0
                },
                {
                    "Name": "袁生",
                    "WeChat": "yllw10125",
                    "Phone": "18814359697",
                    "AuthorizationCode": "ABGIH09",
                    "BrandLevelName": "普通代理商",
                    "CardPath": "http://haijisz8.hyxmt.cn:80/NewCustomer/CardShow.aspx?v=44FC0861A2FCE74543B17B05BECFA86253A72585044C3DA0&",
                    "BrandField1": "",
                    "BrandField2": "",
                    "BrandField3": "",
                    "BrandField4": "",
                    "BrandField5": "",
                    "Brand_ParentName": "向明涛",
                    "CustomField5": "甘肃省积石山县柳沟乡斜套村四社",
                    "CustomField6": "甘肃省",
                    "CustomField7": "临夏回族自治州",
                    "CustomField8": "",
                    "HeadUrl": "http://haijisz8.hyxmt.cn/Upload/ShareUrl/20180708/201807081751301502771.jpg",
                    "Customer_ID": 168962,
                    "Brand_ID": 1,
                    "BrandName": null,
                    "BrandLevel": 5,
                    "RowNo": 2,
                    "LowerState": "0",
                    "Brand_ParentId": 3351,
                    "State": "1",
                    "Qty": 0,
                    "TeamQty": 0
                },
                {
                    "Name": "邝利秀",
                    "WeChat": "13717097865",
                    "Phone": "13717097865",
                    "AuthorizationCode": "ABHCC05",
                    "BrandLevelName": "30盒折扣零售",
                    "CardPath": "http://haijisz8.hyxmt.cn:80/NewCustomer/CardShow.aspx?v=BCCC5EA487C7B8308D4D1B16E47D8647A53115D293714F8B&",
                    "BrandField1": "",
                    "BrandField2": "",
                    "BrandField3": "",
                    "BrandField4": "",
                    "BrandField5": "",
                    "Brand_ParentName": "向明涛",
                    "CustomField5": "湖南省蓝山县所城镇长铺村1组",
                    "CustomField6": "",
                    "CustomField7": "",
                    "CustomField8": "",
                    "HeadUrl": "http://haijisz8.hyxmt.cn/Upload/ShareUrl/20180712/201807122126393825269.jpg",
                    "Customer_ID": 172458,
                    "Brand_ID": 1,
                    "BrandName": null,
                    "BrandLevel": 6,
                    "RowNo": 2,
                    "LowerState": "0",
                    "Brand_ParentId": 3351,
                    "State": "1",
                    "Qty": 0,
                    "TeamQty": 1
                }
            ]
        };
    }

    //组件挂载后回调
    componentDidMount() {
        document.title = "";

    }

    render() {
        return <div className="CheckNextAgent">
            <NavBar title={'植物精油下级代理'} searchClick={() => {

            }}/>

            {this.state.NextAgentList.map((it) => {
                return <div className="item">
                    <span className="number">{it.Brand_ID}</span>
                    <div className="info">
                        <img src={it.HeadUrl}/>
                        <div className={'flex_1'}>
                            <div>
                                <span>{it.Brand_ParentName}</span>
                                <span>{it.BrandLevelName}:{it.AuthorizationCode}</span>
                            </div>
                            <div>
                                <span>{it.Phone}</span>
                                <span>直属人数:{it.Qty}</span>
                            </div>

                            <div>
                                <span>{it.WeChat}</span>
                                <span>团队人数:{it.TeamQty}</span>
                            </div>
                        </div>
                    </div>

                    <button className={'flex_1 btn btn-watch'}>
                        {it.Qty + it.TeamQty > 0 ?
                            <i className="iconfont icon-jiantou"/> : null}
                    </button>
                </div>
            })}
        </div>
    }
}
